﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RemoteImaging
{
    public partial class FormChooseDirectory : Form
    {
        public FormChooseDirectory()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (Directory.Exists(textBoxDirectory.Text))
            {
                Properties.Settings.Default.OutputPath = textBoxDirectory.Text;
                Properties.Settings.Default.Save();
                DialogResult = DialogResult.OK;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            using (var dlg = new FolderBrowserDialog())
            {
                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    textBoxDirectory.Text = dlg.SelectedPath;
                }
                
            }
        }
    }
}
